<?php

require_once 'config.php';
$db = new DatabaseOperations();
$arr = array("NULL","bb","bb","bb");

#$db->insert("student",$arr);
 
class DatabaseOperations	{
	
	function insert($table,$values)	{
	$this->connect();		
	$query = "INSERT INTO `$table` VALUES";
	$val='';
	
	foreach($values as $attribute)
	$val = $val."'".$attribute."'".",";
	$query = $query." (".substr($val,0,-1).")";
	
	mysql_query($query)or die ('MySQL connect failed. ' . mysql_error());
		
	}
	
	function connect()	{
		$dbConn = mysql_pconnect (DBHOST,DBUSER,DBPASS) or die ('MySQL connect failed. ' . mysql_error());
		mysql_select_db(DBNAME);
	}
	
}
?>